hackerrank ruby tutorials object methods problem solution